package cn.coisini.controller.v1;

import cn.coisini.api.search.ArticleSearchControllerApi;
import cn.coisini.model.common.annotation.RedisAccessLimit;
import cn.coisini.model.common.dtos.Result;
import cn.coisini.model.common.log.annotation.Log;
import cn.coisini.model.common.log.enums.BusinessType;
import cn.coisini.model.dto.UserSearchDto;
import cn.coisini.service.ArticleService;
import lombok.RequiredArgsConstructor;
import org.springframework.web.bind.annotation.RestController;

/**
 * @author xiangshaw
 * Description: 文章搜索接口
 */
@RestController
@RequiredArgsConstructor
public class ArticleSearchController implements ArticleSearchControllerApi {

    private final ArticleService articleService;

    @Override
    @RedisAccessLimit(seconds = 60, maxCount = 30)
    @Log(title = "文章搜索管理", businessType = BusinessType.SELECT)
    public Result<Object>  getUserSearchArticle(UserSearchDto userSearchDto) {
        return  articleService.getUserSearchArticle(userSearchDto);
    }
}
